package cn.edu.zafu.bigdata.zengyadian;

class InvalidScoreException extends Exception {
    public InvalidScoreException(String message) {
        super(message);
    }
}

public class ScoreValidation {
    public static void checkScore(int score) throws InvalidScoreException {
        if (score < 0 || score > 100) {
            throw new InvalidScoreException("输入的分数不在 0 到 100 之间，无效输入。");
        }
        System.out.println("分数有效。");
    }

    public static void main(String[] args) {
        try {
            int score = Integer.parseInt(args[0]);
            checkScore(score);
        } catch (NumberFormatException e) {
            System.out.println("输入不是有效的整数。");
        } catch (InvalidScoreException e) {
            System.out.println("发生错误：" + e.getMessage());
        }
    }
}
